<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>校友会系统后台</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
  <!-- Font Awesome -->
  <link rel="stylesheet" th:href="${basePath}+'/plugins/fontawesome-free/css/all.min.css'">
  <!-- Ionicons -->
  <link rel="stylesheet" th:href="${basePath}+'/dist/css/ionicons.min.css'">
  <!-- icheck bootstrap -->
  <link rel="stylesheet" th:href="${basePath}+'/plugins/icheck-bootstrap/icheck-bootstrap.min.css'">
  <!-- Theme style -->
  <link rel="stylesheet" th:href="${basePath}+'/dist/css/adminlte.min.css'">
  <!-- Google Font: Source Sans Pro -->
  <link th:href="${basePath}+'/dist/css/Source_Sans.css'" rel="stylesheet">
</head>
<body class="hold-transition login-page">
<div class="login-box">
  <div class="login-logo">
    <a href="#"><b>校友会系统后台</b></a>
  </div>
  <!-- /.login-logo -->
  <div class="card">
    <div class="card-body login-card-body">
      <p class="login-box-msg">登录用户凭证</p>

      <form th:action="@{/login}" action="/login" method="post">
        <div class="input-group mb-3">
          <input type="text" name="username" class="form-control" placeholder="用户名">
          <div class="input-group-append">
            <div class="input-group-text">
              <span class="fas fa-envelope"></span>
            </div>
          </div>
        </div>
        <div class="input-group mb-3">
          <input type="password" name="password" class="form-control" placeholder="密码" autocomplete='tel'>
          <div class="input-group-append">
            <div class="input-group-text">
              <span class="fas fa-lock"></span>
            </div>
          </div>
        </div>
        <div class="input-group mb-3">
          <input type="text" name="vrifyCode" class="form-control" placeholder="验证码">
          <img alt="验证码" th:src="${#httpServletRequest.contextPath}+'/defaultKaptcha'" id="img"/>

        </div>
        <div class="row">
          <div class="col-8">
            <div class="icheck-primary">
              <input type="checkbox" id="remember" name="remember-me">
              <label for="remember">
                记住我
              </label>
            </div>
          </div>
          <!-- /.col -->
          <div class="col-4">
            <button type="submit" class="btn btn-primary btn-block btn-flat">登录</button>
          </div>
          <!-- /.col -->
        </div>
      </form>

      <!-- /.social-auth-links -->

    </div>
    <!-- /.login-card-body -->
  </div>
</div>
<!-- /.login-box -->

<!-- jQuery -->
<script th:src="${basePath}+'/plugins/jquery/jquery.min.js'"></script>
<!-- Bootstrap 4 -->
<script th:src="${basePath}+'/plugins/bootstrap/js/bootstrap.bundle.min.js'"></script>
<!-- AdminLTE App -->
<script th:src="${basePath}+'/dist/js/adminlte.min.js'"></script>
<script th:src="${basePath}+'/plugins/layer/layer.min.js'"></script>
<script>
	$().ready(function(){
		if (self.frameElement && self.frameElement.tagName == "IFRAME") {
			　　window.parent.location.reload();
		}
		let src=$("#img").attr('src');
		$("#img").click(function(){
			$(this).attr('src',src+'?d='+new Date()*1);
		});
		var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
		var errorName = window.location.search.substr(1);
		if(''!=errorName){
				if(errorName=='error'){
					layer.msg('输入信息有误'
// 							, { icon: 2, closeBtn: 0 }		
					);
				}else if(errorName=='kerror'){
					layer.alert('验证码错误');
				}
				
		}
	});
</script>
</body>
</html>
